<%--
    Document   : detailProjet
    Created on : 10 févr. 2011, 12:48:30
    Author     : Amanda & Rami
--%>

<%@page import="beans.Projet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<% boolean isAdmin = (Boolean) request.getSession().getAttribute("isAdmin");%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>AGP : D&eacute;tails d&prime;un projet</title>
        <link rel="stylesheet" media="screen" type="text/css" title="Design" href="./css/design_corps.css" />
        <link rel="stylesheet" media="screen" type="text/css" title="Design" href="./css/design_details.css" />
    </head>
    <body>
         <div id="page">
            <form action="Controleur" method="POST">
                <jsp:include page="_banniere.jsp"/>
                <jsp:include page="_menu.jsp"/>
                <div id="corps">
                    <% Projet p = (Projet)request.getAttribute("detailProjet"); %>
                    <%
                        String promotion ;
                        switch(p.getPromotion())
                        {
                            case 1 : promotion = "M1 FIC"; break;
                            case 2 : promotion = "M1 FA"; break;
                            case 3 : promotion = "M2 FIC"; break;
                            case 4 : promotion = "M2 FA"; break;
                            default : promotion = "INCONNU";
                        }
                    %>
                    <div id="corps_titre">D&eacute;tails du projet : <%= p.getNom()%></div>
                    <div id="details_bloc">
                        <div id="details_bloc1">
                            <div id="details_text">Nom</div>
                            <div id="details_champs"><%= p.getNom()%></div>
                        </div>
                        <div id="details_bloc2">
                            <div id="details_text">Date de d&eacute;but</div>
                            <div id="details_champs"><%= p.getDateDebut()%></div>
                        </div>
                        <div id="details_bloc3">
                            <div id="details_text">Date de fin</div>
                            <div id="details_champs"><%= p.getDateFin()%></div>
                        </div>
                        <div id="details_bloc4">
                            <div id="details_text">Promotion</div>
                            <div id="details_champs"><%= promotion %></div>
                        </div>
                        <div id="details_bloc5">
                            <div id="details_text">Description</div>
                            <div id="details_champs"><%= p.getDescriptif()%></div>
                        </div>
                        <div id="details_bloc6">
                            <div id="details_text">Formateurs</div>
                            <% for (int i = 0 ; i < p.getFormateurs().size();i++){%>
                                <div id="details_champs_dynamique">
                                    <%= p.getFormateurs().get(i).getNom()%>&nbsp;
                                    <%= p.getFormateurs().get(i).getPrenom()%>
                                </div>
                            <% }%>
                        </div>
                        <div id="details_bloc7">
                            <div id="details_text">Mati&egrave;res</div>
                            <% for (int i = 0 ; i < p.getModules().size();i++){%>
                                <div id="details_champs_dynamique">
                                    <%= p.getModules().get(i).getNom()%>
                                </div>
                            <% }%>
                        </div>
                        <div id="details_bloc8">
                            <div id="details_text">&Eacute;quipes</div>
                            <% if (p.getEquipes().size()!=0){ %>
                                <% for (int i = 0 ; i < p.getEquipes().size();i++){%>
                                    <div id="details_text2">&Eacute;quipe <%=i+1%></div>
                                    <% for (int y = 0 ; y < p.getEquipes().get(i).getEtudiants().size();y++){%>
                                        <div id="details_champs_dynamique">
                                            <%= p.getEquipes().get(i).getEtudiants().get(y).getNom()%>&nbsp;
                                            <%= p.getEquipes().get(i).getEtudiants().get(y).getPrenom()%>
                                            &nbsp;&nbsp;/&nbsp;&nbsp;
                                            Id : <%= p.getEquipes().get(i).getEtudiants().get(y).getIdEtudiant()%>
                                        </div>
                                    <% }%>
                                <% }%>
                            <% }%>
                        </div>
                    </div>
                    <div id="details_bouton">
                        <%if(isAdmin){%>
                            <input type="hidden" name="numero" value="<%=p.getIdProjet()%>" />
                            <input id="details_bouton_supprimer" type="submit" name="action" value="Supprimer" />
                            <input id="details_bouton_modifier" type="submit" name="action" value="Modifier" />                                                                                 
                        <%}%>
                    </div>
                </div>
            </form>
         </div>
    </body>
</html>
